<template>
  <a-drawer
    class="custom-drawer"
    :title="detail.caption"
    :visible="visible"
    width="720px"
    placement="right"
    @close="onClose"
  >
    <!-- 招商信息 -->
    <template v-if="detail.type === 'info'">
      <div class="company">
        <div class="title">{{ detail.title }}</div>
        <a-row class="mt12">
          <a-col :span="24"
            ><span class="col-9">项目需求：</span
            >{{ detail.projectNeed }}</a-col
          >
          <a-col class="mt4" :span="24"
            ><span class="col-9">联系方式：</span
            >{{ detail.projectLink }}</a-col
          >
        </a-row>
      </div>
      <div class="summary">
        <div class="title">载体简介</div>
        <div class="mt12" v-html="detail.info"></div>
      </div>
    </template>
    <!-- 接受人数 -->
    <template v-else>
      <a-table
        bordered
        :data-source="detail.list"
        :columns="columns"
        :rowKey="
          (record, index) => {
            return index
          }
        "
        :pagination="false"
      >
        <template slot="headImg" slot-scope="text">
          <img :src="text" />
        </template>
      </a-table>
    </template>
  </a-drawer>
</template>
<script>
import config from '../config'
// import { dataSource as ds } from '@/services'
// import { isNull } from "@/utils/util"
export default {
  name: 'drawer',

  data() {
    return {
      visible: false,
      columns: config.infoColumns,
      detail: {}
    }
  },
  methods: {
    open(e) {
      this.detail = e
      this.visible = true
    },
    onClose() {
      this.visible = false
    }
  }
}
</script>

<style lang="less" scoped>
.title {
  color: #333;
  font-size: 16px;
  font-weight: bold;
}
.company {
  padding: 20px 0;
  border-bottom: 1px dashed #ececec;
  .name {
    color: #333;
    font-size: 16px;
    font-weight: bold;
  }
  .item {
    color: #f5222d;
    font-size: 16px;
    font-weight: bold;
  }
  /deep/.ant-tag-red {
    color: #f5222d !important;
  }
  .info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ececec;
  }
}
.liaisons {
  padding: 20px 0;
  border-bottom: 1px dashed #ececec;
  .ant-row {
    margin-top: 10px;
  }
}
.summary {
  padding: 20px 0;
  border-bottom: 1px dashed #ececec;
}
</style>
